package com.example.lifecycle;

import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
import android.view.WindowManager;

import androidx.annotation.Nullable;

public class test3 extends Activity {

    private static final String TAG2 = "test3";

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_test3);
        WindowManager.LayoutParams params = getWindow().getAttributes();
        params.height = (int) (getWindowManager().getDefaultDisplay().getHeight() * 0.3); // 高度设置为屏幕的0.3
        params.width = (int) (getWindowManager().getDefaultDisplay().getWidth() * 0.8); // 宽度设置为屏幕的0.8
        getWindow().setAttributes(params);
        Log.d(TAG2,"This is test1 in test3");
    }

    @Override
    protected void onStart() {
        super.onStart();
        Log.d(TAG2,"This is onStart in test3");
    }

    @Override
    protected void onRestart (){
        super.onRestart();
        Log.d(TAG2,"This is onRestart in test3");
    }

    @Override
    protected void onResume() {
        super.onResume();
        Log.d(TAG2,"This is onResume in test3");
    }

    @Override
    protected void onPause() {
        super.onPause();
        Log.d(TAG2,"This is onPause in test3");
    }

    @Override
    protected void onStop() {
        super.onStop();
        Log.d(TAG2,"This is onStop in test3");
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        Log.d(TAG2,"This is onDestroy in test3");
    }
}
